package com.david.autostarter.logger.starter;


import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.config.AbstractFactoryBean;

public abstract class AbstractMyLogFactoryBean<T> implements FactoryBean<T>, InitializingBean {

    private T proxyTarget;
    private Class<T> mapperInterface;
    private DefaultLogSupport logSupport = new DefaultLogSupport();

    @Override
    public T getObject() throws Exception {
        return proxyTarget;
    }

    @Override
    public Class<T> getObjectType() {
        return mapperInterface;
    }

    public Class<T> getMapperInterface() {
        return mapperInterface;
    }

    public void setMapperInterface(Class<T> mapperInterface) {
        this.mapperInterface = mapperInterface;
    }

    @Override
    public boolean isSingleton() {
        return true;
    }

    public LogSupport getLogSupport() {
        return logSupport;
    }

    public void setProxyTarget(T proxyTarget) {
        this.proxyTarget = proxyTarget;
    }

    public void setLogSupport(DefaultLogSupport logSupport) {
        this.logSupport = logSupport;
    }

}